﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="NovoUsuario.aspx.cs" Inherits="SistemaAcademico.Pages.NovoUsuario" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $('.ddlTipoCadastro').change(function () {

                $('.divDinamica').hide();
                $('.div' + $(this).val()).show();
            });

            var a = $('.ddlTipoCadastro option:selected').index();
            if (a == 1) {
                $('.divProfessor').show();
                $('.divAluno').hide();
            }
            if (a == 0) {
                $('.divProfessor').hide();
                $('.divAluno').show();
            }
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <form runat="server">
        <h1 class="page-title">
            <i class="icon-pushpin"></i>Novo usuário
        </h1>
        <div runat="server" class="widget">
            <div class="widget-header">
                <h3>Cadastro</h3>
            </div>
            <div runat="server" class="widget-content form-horizontal">
                <fieldset runat="server">
                    <p class="help-block">
                        Todos campos com * são obrigatórios
                    </p>
                    <h3>-Informações básicas</h3>
                    <div runat="server" class="control-group">
                        <label runat="server" class="control-label" for="txtUserName">
                            Login*</label>
                        <div runat="server" class="controls">
                            <asp:TextBox required="required" ID="txtUserName" CssClass="input-medium" runat="server"></asp:TextBox>
                            <p class="help-block">
                                Seu login é feito para ter acesso ao portal e não poderá ser mudado. Ele deverá conter 6 letras no mínimo.
                            </p>
                        </div>
                        <!-- /controls -->
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="txtNomeCompleto">
                            Tipo de cadastro</label>
                        <div class="controls">
                            <asp:DropDownList CssClass="ddlTipoCadastro" ID="ddlCadastro" runat="server">
                                <asp:ListItem Text="Aluno" Value="Aluno"></asp:ListItem>
                                <asp:ListItem Text="Professor" Value="Professor"></asp:ListItem>
                                <asp:ListItem Text="Administrador" Value="Administrador"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                        <!-- /controls -->
                    </div>
                    <!-- /control-group -->
                    <div class="control-group">
                        <label class="control-label" for="txtNomeCompleto">
                            Nome completo*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtNomeCompleto" required="required" CssClass="input-medium" runat="server"></asp:TextBox>
                        </div>
                        <!-- /controls -->
                    </div>
                    <!-- /control-group -->
                    <div class="control-group">
                        <label class="control-label" for="txtNascimento">
                            Data de nascimento*
                        </label>
                        <div class="controls">
                            <asp:TextBox ID="txtNascimento" CssClass="input-medium" required="required" runat="server"></asp:TextBox>
                            <p class="help-block">
                                Modelo: DD/MM/AAAA
                            </p>
                        </div>
                        <!-- /controls -->
                    </div>
                    <!-- /control-group -->
                    <div class="control-group">
                        <label class="control-label" for="txtEmail">
                            E-mail*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtEmail" CssClass="input-medium" required="required" runat="server"></asp:TextBox>
                        </div>
                        <!-- /controls -->
                    </div>
                    <!-- /control-group -->
                    <div class="control-group">
                        <label class="control-label" for="txtCPF">
                            CPF*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtCPF" CssClass="cpf input-medium" required="required" runat="server"></asp:TextBox>
                            <p class="help-block">
                                Não digite pontos ou traços.
                            </p>
                        </div>
                        <!-- /controls -->
                    </div>
                    <!-- /control-group -->
                    <div class="control-group">
                        <label class="control-label" for="txtRG">
                            RG*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtRG" CssClass="input-medium" required="required" runat="server"></asp:TextBox>
                            <p class="help-block">
                                Não digite pontos ou traços.
                            </p>
                        </div>
                        <!-- /controls -->
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="txtTelefone1">
                            Telefone Principal*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtTelefone1" CssClass="input-medium" required="required" runat="server"></asp:TextBox>
                            <p class="help-block">
                                DDD+Telefone
                            </p>
                        </div>
                        <!-- /controls -->
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="txtTelefone2">
                            Telefone Alternativo</label>
                        <div class="controls">
                            <asp:TextBox ID="txtTelefone2" CssClass="input-medium" runat="server"></asp:TextBox>
                        </div>
                        <!-- /controls -->
                    </div>
                    <h3>-Endereço</h3>
                    <div class="control-group">
                        <label class="control-label" for="txtCEP">
                            CEP</label>
                        <div class="controls">
                            <asp:TextBox ID="txtCEP" required="required" CssClass="input-medium" runat="server"></asp:TextBox>
                            <p class="help-block">
                                Não digite pontos ou traços.
                            </p>
                        </div>
                        <!-- /controls -->
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="txtTelefone2">
                            Logradouro*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtLogradouro" required="required" CssClass="input-medium" runat="server"></asp:TextBox>
                        </div>
                        <!-- /controls -->
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="txtBairro">
                            Bairro*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtBairro" CssClass="input-medium" required="required" runat="server"></asp:TextBox>
                        </div>
                        <!-- /controls -->
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="txtTelefone2">
                            Cidade*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtCidade" CssClass="input-medium" required="required" runat="server"></asp:TextBox>
                        </div>
                        <!-- /controls -->
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="txtTelefone2">
                            Estado*</label>
                        <div class="controls">
                            <asp:DropDownList ID="ddlEstados" runat="server">
                                <asp:ListItem Text="AC" Value="AC"></asp:ListItem>
                                <asp:ListItem Value="AL" Text="AL"></asp:ListItem>
                                <asp:ListItem Value="AP" Text="AP"></asp:ListItem>
                                <asp:ListItem Value="AM" Text="AM"></asp:ListItem>
                                <asp:ListItem Value="BA" Text="BA"></asp:ListItem>
                                <asp:ListItem Value="CE" Text="CE"></asp:ListItem>
                                <asp:ListItem Value="DF" Text="DF"></asp:ListItem>
                                <asp:ListItem Value="ES" Text="ES"></asp:ListItem>
                                <asp:ListItem Value="GO" Text="GO"></asp:ListItem>
                                <asp:ListItem Value="MA" Text="MA"></asp:ListItem>
                                <asp:ListItem Value="MT" Text="MT"></asp:ListItem>
                                <asp:ListItem Value="MS" Text="MS"></asp:ListItem>
                                <asp:ListItem Value="MG" Text="MG"></asp:ListItem>
                                <asp:ListItem Value="PA" Text="PA"></asp:ListItem>
                                <asp:ListItem Value="PB" Text="PB"></asp:ListItem>
                                <asp:ListItem Value="PR" Text="PR"></asp:ListItem>
                                <asp:ListItem Value="PE" Text="PE"></asp:ListItem>
                                <asp:ListItem Value="PI" Text="PI"></asp:ListItem>
                                <asp:ListItem Value="RJ" Text="RJ"></asp:ListItem>
                                <asp:ListItem Value="RN" Text="RN"></asp:ListItem>
                                <asp:ListItem Value="RS" Text="RS"></asp:ListItem>
                                <asp:ListItem Value="RO" Text="RO"></asp:ListItem>
                                <asp:ListItem Value="RR" Text="RR"></asp:ListItem>
                                <asp:ListItem Value="SC" Text="SC"></asp:ListItem>
                                <asp:ListItem Value="SP" Text="SP"></asp:ListItem>
                                <asp:ListItem Value="SE" Text="SE"></asp:ListItem>
                                <asp:ListItem Value="TO" Text="TO"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                        <!-- /controls -->
                    </div>
                    <div class="divAluno divDinamica" style="display: none;">
                        <h3>-Dados específicos do aluno</h3>
                        <div class="control-group">
                            <label class="control-label" for="txtFormacao">
                                Turma</label>
                            <div class="controls">
                                <asp:DropDownList ID="ddlTurma" runat="server" DataSourceID="SqlDtSrcTurmas" DataTextField="DataField" DataValueField="Id">
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="SqlDtSrcTurmas" runat="server" ConnectionString="<%$ ConnectionStrings:SATCCConnectionString %>" SelectCommand="SELECT TurmaSet.Id, TurmaSet.cdPeriodo, TurmaSet.dtInicio, TurmaSet.Curso_Id, TurmaSet.Atribuido, CursoSet.nmCurso, CursoSet.nmCurso + ' - ' + TurmaSet.dtInicio + ' - ' + TurmaSet.cdPeriodo as DataField FROM TurmaSet INNER JOIN CursoSet ON TurmaSet.Curso_Id = CursoSet.Id"></asp:SqlDataSource>
                            </div>
                            <!-- /controls -->
                        </div>
                    </div>
                    <div class="divProfessor divDinamica" style="display: none;">
                        <h3>-Dados específicos de professor</h3>
                        <div class="control-group">
                            <label class="control-label" for="txtFormacao">
                                Formação superior*</label>
                            <div class="controls">
                                <asp:TextBox ID="txtFormacao" CssClass="input-medium" runat="server"></asp:TextBox>
                            </div>
                            <!-- /controls -->
                        </div>
                        <div class="row">
                            <div class="offset1 span3">
                                <label class="control-label" for="">
                                    Disciplinas disponíveis</label>
                                <asp:ListBox ID="lstDisciplinasOferecidas" runat="server" DataSourceID="sqlDtSrcMateria" DataTextField="nmMateria" DataValueField="Id"></asp:ListBox>
                                <asp:SqlDataSource ID="sqlDtSrcMateria" runat="server" ConnectionString="<%$ ConnectionStrings:SATCCConnectionString %>" SelectCommand="SELECT [Id], [nmMateria] FROM [MateriaSet] ORDER BY [nmMateria]"></asp:SqlDataSource>
                            </div>
                            <div class="span1" style="padding-top: 4%; padding-left: 4%;">
                                <div class="row"><a id="btnAdd" runat="server"><i class="icon-arrow-right icon-2x"></i></a></div>
                                <div class="row"><a id="btnRem" runat="server"><i class="icon-arrow-left icon-2x "></i></a></div>
                            </div>
                            <div class="span3">
                                <label class="control-label" for="">
                                    Disciplinas ministradas</label>
                                <asp:ListBox ID="lstDisciplinasMinistradas" runat="server"></asp:ListBox>
                            </div>
                        </div>
                    </div>
                    <h3>-Senha</h3>
                    <div class="control-group">
                        <label class="control-label" for="password1">
                            Senha*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtSenha" required="required" TextMode="Password" CssClass="input-medium" runat="server"></asp:TextBox>
                            <p class="help-block">
                                Sua senha deverá ter 6 dígitos.
                            </p>
                        </div>
                        <!-- /controls -->
                    </div>
                    <!-- /control-group -->
                    <div class="control-group">
                        <label class="control-label" for="txtConfiSenha">
                            Confirme a senha*</label>
                        <div class="controls">
                            <asp:TextBox ID="txtConfiSenha" required="required" TextMode="Password" CssClass="input-medium" runat="server"></asp:TextBox>
                        </div>
                        <!-- /controls -->
                    </div>
                    <!-- /control-group -->
                    <br />
                    <asp:Button ID="btnContinuar" CssClass="btn btn-primary btnSalvar" runat="server"
                        Text="Continuar" OnClick="btnContinuar_Click" />
                </fieldset>
            </div>
        </div>
    </form>
</asp:Content>
